<template>
	<view>


		<view class="cenetr_box">
			<view class="r">
				<text>总收益：{{equipmentInfo.totalIncome}}</text>
			</view>
			<view class="r">
				<text>昨天收益：{{equipmentInfo.yesterIncome}}</text>
			</view>
		</view>
		<view class="equipment_list">
			<view v-for="(item,index) in list" :key="index">

				<view class="equipment_item black" v-if="item.onlineCode==0"
					@click="jump(`/pageC/equipmentDetail?name=${item.sn}&onlineCode=${item.onlineCode}`)">
					<view class="l">
						<image src="/static/newProject/equipment/equipment3.png" mode=""></image>
						<view class="center_info">
							<view class="text1">
								{{item.desc}}
							</view>
							<view class="text2">
								{{item.addrIspCode}}
							</view>
							<view class="text">
								<view class="b">

								</view>
								<view class="info">
									{{item.sn}}
								</view>
							</view>

						</view>
					</view>
					<view class="r">
						<view class="info">
							<text>+{{item.income}}</text>
							<text>总72.39</text>
							<text>查看详情</text>
						</view>
						<image src="/static/newProject/equipment/icon_r.png" mode=""></image>
					</view>
				</view>
				<view class="equipment_item gray" v-else-if="item.onlineCode==1"
					@click="jump(`/pageC/equipmentDetail?name=${item.sn}&onlineCode=${item.onlineCode}`)">
					<!-- <view class="equipment_item gray" v-else -->
					<view class="l">
						<image src="/static/newProject/equipment/equipment3.png" mode=""></image>
						<view class="center_info">
							<view class="text1">
								{{item.desc}}
							</view>
							<view class="text2">
								{{item.desc}}
							</view>
							<view class="text">
								<view class="b">

								</view>
								<view class="info">
									{{item.sn}}
								</view>
							</view>

						</view>
					</view>
					<view class="r">
						<view class="info">
							<text>+{{item.income}}</text>
							<text>总72.39</text>
							<text>查看详情</text>
						</view>
						<image src="/static/newProject/equipment/icon_r.png" mode=""></image>
					</view>
				</view>
				<view class="equipment_item black" style="background: rgba(255, 0, 0,.3)" v-else
					@click="jump(`/pageC/equipmentDetail?name=${item.sn}&onlineCode=${item.onlineCode}`)">
					<!-- <view class="equipment_item gray" v-else -->
					<view class="l">
						<image src="/static/newProject/equipment/equipment3.png" mode=""></image>
						<view class="center_info">
							<view class="text1">
								{{item.desc}}
							</view>
							<view class="text2">
								{{item.desc}}
							</view>
							<view class="text">
								<view class="b">

								</view>
								<view class="info">
									{{item.sn}}
								</view>
							</view>

						</view>
					</view>
					<view class="r">
						<view class="info">
							<text>+{{item.income}}</text>
							<text>总72.39</text>
							<text>查看详情</text>
						</view>
						<image src="/static/newProject/equipment/icon_r.png" mode=""></image>
					</view>
				</view>
			</view>
	</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title: option.name
			})
			this.getUserSnList()
		},
		methods:{
			getUserSnList(page, limit,group_id,onlineCode=-1) {
				this.$fun.ajax.post('butt/userSnList', {
					page,
					limit,
					group_id,
					onlineCode
				}).then(res => {
					// console.log(res)
					if (res.data.list.length > 0) {
						this.list.push(...res.data.list);
						// this.addressList = res.data
						this.page++
					} else {
						if (this.page != 1) {
							this.$fun.msg('没有更多数据了...')
						}
					}
					this.equipmentInfo = res.data
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #EEEEEE;

		.groupingList {
			margin: 25rpx 32rpx;

			.groupingItem {
				width: 100%;
				height: 112rpx;
				background: #FFFFFF;
				border-radius: 12rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 40rpx;
				margin-bottom: 20rpx;

				.l {
					display: flex;
					align-items: center;

					.groupingName {
						font-size: 32rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #333333;
					}

					.tip {
						font-size: 26rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #999999;
					}
				}

				.r {
					font-size: 28rpx;
					font-family: Adobe Heiti Std;
					font-weight: normal;
					color: #2980F7;
				}
			}
		}

		.add-btn {
			position: fixed;
			left: 30upx;
			right: 30upx;
			bottom: 16upx;
			z-index: 95;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 690upx;
			height: 80upx;
			font-size: 32upx;
			color: #fff;
			background-color: #2980F7;
			border-radius: 10upx;
			box-shadow: 1px 2px 5px #2980F7;
		}
	}
</style>
